import request from '@/utils/request'

// 查询VIP码列表
export function listCode(query) {
  return request({
    url: '/travel/code/list',
    method: 'get',
    params: query
  })
}

// 查询VIP码详细
export function getCode(id) {
  return request({
    url: '/travel/code/' + id,
    method: 'get'
  })
}

// 新增VIP码
export function addCode(data) {
  return request({
    url: '/travel/code?number='+data.number+'&endTime='+data.endTime,
    method: 'get'
  })
}

// 修改VIP码
// export function updateCode(data) {
//   return request({
//     url: '/travel/code',
//     method: 'put',
//     data: data
//   })
// }

// 删除VIP码
export function delCode(id) {
  return request({
    url: '/travel/code/' + id,
    method: 'delete'
  })
}

// 导出VIP码
export function exportCode(query) {
  return request({
    url: '/travel/code/export',
    method: 'get',
    params: query
  })
}
